Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unnecessary and harmful copy of pandas objects #147

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

johannes-mueller
Copy link
Member

Fix #146

Inheritants of `PyLifeSignal` generally need not implement `.__init__()`
`PyLifeSinal` calls `.validate()`.

Signed-off-by: Johannes Mueller <johannes.mueller4@de.bosch.com>
@@ -52,10 +52,6 @@ class WoehlerCurve(PylifeSignal):
or calculated from ``TN`` if given.
"""

def __init__(self, pandas_obj):
self._obj = pandas_obj.copy()
self._validate()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what is the difference now? The exact same constructor is in PylifeSignal so nothing changed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah except the copy

@maierbn maierbn self-requested a review December 13, 2024 11:48
@johannes-mueller johannes-mueller merged commit 534c27c into develop Dec 13, 2024
14 checks passed
@johannes-mueller johannes-mueller deleted the 146-pylife-signals-copy-pandas branch December 13, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PylifeSignals must not copy objects
2 participants